#pragma once

#include <iostream>
#include <fstream>

//first, a few predefined constants
const int LOG_APP=1;
const int LOG_CLIENT=2;
const int LOG_SERVER=4;
//LOG_USER is used to display the log message to the user - i.e. in a dialog box
const int LOG_USER=8;
const int LOG_DEBUG=16;

#define MAX_LOG_STRINGS 256

using namespace std;

class EngineLog
{
public:
	static EngineLog& Get();
   
	bool Init();
   
	void Write(int target, const char *msg, ...);
	void Write(int target, unsigned long msgID, ...);

protected:
	EngineLog();
   
	ofstream appLog;
	ofstream clientLog;
	ofstream serverLog;
   
	std::string logStrings[MAX_LOG_STRINGS];
	bool LoadStrings();
};
